package com.zirenx.common.config;

import com.jfinal.render.ErrorRender;
import com.jfinal.render.Render;
import com.jfinal.render.RenderFactory;

import javax.servlet.http.HttpServletRequest;

public class MyRenderFactory extends RenderFactory{
	
	@Override
	public Render getErrorRender(int errorCode) {
		if(errorCode == 404) {
			return new ErrorRender(errorCode, ConstantConfig.ADMIN_PATH + "error/404.html");
		}else if (errorCode == 403){
			return new ErrorRender(errorCode, ConstantConfig.ADMIN_PATH + "error/403.html");
		}
		return new ErrorRender(errorCode, constants.getErrorView(errorCode));
	}
}
